<style>
.fui-goods-group .vote-number{
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    overflow: hidden;
    padding: 0 10px;
    -webkit-border-bottom-right-radius: 5px;
    -moz-border-radius-bottomright: 5px;
    border-bottom-left-radius: 5px;
    height: 25px;
    line-height: 25px;
    background-color: #000;
    background-color: rgba(0,0,0,0.5);
    color: #FFF;
    text-align: center;
    font-size: 12px;
}
</style>
<div class="fui-page order-create-page fui-page-current" >
	<div class="fui-content">
		<div id="carousel-container" class="carousel slide" data-role="carousel" data-param-auto="true">
		<div class="carousel-inner" role="listbox" style="height:6rem">
			<div ng-class="{'item':1,'active':$index==0}" ng-repeat="item in pagedata.banner">
				<a href="#">
					<img ng-src="{{tomedia(item.picurl) || '../core/resource/images/banner-1.jpg'}}" style="display: block; width: 100%; height: 100%;">
				</a>
			</div>
		</div>
		<style>
				.fui-swipe-page .fui-swipe-bullet {background: {background}; opacity: {opacity};}
				.fui-swipe-page .fui-swipe-bullet.active {opacity: 1;}
		</style>
			<div id="carousel-jinyun" class="fui-swipe-page" style="padding: 0 5px; bottom: 10px; ">
					<div class="fui-swipe-bullet" ng-repeat="item in pagedata.banner" ng-class="{'active':$index==0}" data-target="#carousel-container" data-slide-to="{{$index}}"></div>
			</div>
		</div>
		<div ng-if="pagedata.groups.length>0" class="fui-icon-group noborder col-4 radius" style="background: #ffffff">
			<a class="fui-icon-col external" ng-repeat="classify in pagedata.groups" href="javascript:;" ng-click="access_json('jy_zhongchou/c_detail/main/id='+classify.id)" data-nocache="true">
					<div class="icon"><img ng-src="{{tomedia(classify.classify_logo) || '../core/resource/images/nopic.jpg'}}"></div>
					<div class="text" style="color: #666666;">{{classify.title}}</div>
			</a>
		</div>
		<div class="swiper swiper-3" data-view="5" data-btn="true">
            <link href="../core/resource/components/swiper/swiper.min.css" rel="stylesheet" type="text/css">
            <div class="swiper-container fui-picturew" style="padding: 3px 3px; overflow-x: scroll;">
                <div class="swiper-wrapper">
                        <a ng-repeat="item in pagedata.plisthot" class="swiper-slide item" style="margin: 5px;width:150px;background:#fff" href="javascript:;" ng-click="access_json('jy_zhongchou/p_detail/main/id='+item.id)">
							<div class="image" style="width:100%;height:80px;background:url('{{tomedia(item.image) || '../core/resource/images/nopic.jpg'}}') no-repeat 50%;background-size: cover;">
								<div class="vote-number" style="background-color:#0099FF">{{item.classify.title || '未分类'}}</div>
							</div>
                            <div class="text2" style="font-size:0.5rem;margin-bottom:10px;height:1.5rem">{{item.title}}</div>
							<div class="progress" style="margin:5px 3px;height:0.2rem;border-radius:0.05rem;">
								<div class="progress-bar" role="progressbar" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" style="width: {{item.progress || 1}}%;background-color:#3ae0ab;"><span class="sr-only">60% Complete</span></div>
							</div>
							<div class="text" style="font-size:0.7rem;color:#F60;margin-bottom:0.5rem">已筹{{item.getmoney}}元</div>
                        </a>
                </div>
            </div>
        </div>
		<div class="fui-noline">
			<div class="fui-cell" style="color:#000;">
					<div class="fui-cell-icon"><i class="icon jinyunicon icon-juanzeng" style="color:#000;"></i></div>
					<div class="fui-cell-text" style="font-size:13px;color:#000;"> 热门筹</div>
					<div class="fui-cell-remark noremark" ng-click="access_json('jy_zhongchou/p_list/')"><i class="icon jinyunicon icon-icon-test"></i></div>
			</div>
		</div>
		<div class="fui-goods-group no" style="background: ;">
                <a class="fui-goods-item" ng-repeat="item in pagedata.list" style="position: relative;" href="javascript:;" ng-click="access_json('jy_zhongchou/p_detail/main/id='+item.id)">
                    <div class="image" style="width:100px;height:110px;background:url('{{tomedia(item.image) || '../core/resource/images/nopic.jpg'}}') no-repeat 50%;background-size: cover;">
							<div class="vote-number" style="background-color:#0099FF">{{item.classify.title || '未分类'}}</div>
					</div>
					
                        <div class="detail">
                            <div class="name" style="height:1rem;-webkit-line-clamp: 1">
                                    {{item.title}}
                            </div>
							<div class="row" style="background:#f7f7f7;margin:0.3rem">
									<div class="col-jy-3">
										<span style="color: #f60;float:left;text-align:center;width:100%" class="bold">{{item.getmoney}}</span>
										<span style="color: #9a9a9a;float:left;font-size:0.5rem;text-align:center;width:100%" class="ng-binding">已筹金额(元)</span>
									</div>
									<div class="col-jy-3">
										<div class="progress" style="margin:20px 3px;height:0.2rem;border-radius:0.05rem;">
											<div class="progress-bar" role="progressbar" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" style="width: {{item.progress || 1}}%;background-color:#3ae0ab;"><span class="sr-only">60% Complete</span></div>
										</div>
									</div>
									<div class="col-jy-3">
										<span style="color: #f60;float:left;text-align:center;width:100%" class="bold">{{item.goalmoney}}</span>
										<span style="color: #9a9a9a;float:left;font-size:0.5rem;text-align:center;width:100%" class="ng-binding">目标金额(元)</span>
									</div>
                            </div>
                        </div>
                </a>
        </div>
	</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script>
scope.loading = true;  //状态标记
scope.isnodata = false;
scope.pagedata.list =[];
//滚动加载
scope.pagedata.params.keyword = ''
var page = 1;
scope.pagedata.getlist=function(type){
		if(type==1){
			page = 1;
			scope.pagedata.list =[];
		}else{
			
		}
		var keyword = scope.pagedata.params.keyword 
		 if(!keyword || keyword=="undefined" || keyword==0){
			   keyword = '';
		}
		scope.get('jy_zhongchou/index/getlist/page='+page+'&keyword='+keyword,
				function(data){			
				if(data.error !=1){
								for (var i=0;i<data.list.length;i++){
									scope.pagedata.list.push(data.list[i]);
								}
								if(page >1){
									$("#listitem").animate({scrollTop:0},300);
								}
								if(data.list.length<1){
									scope.isnodata=true;
								}
								page++;
								scope.loading = false;
								scope.$evalAsync();
							}else{
								console.log('error!');
							};
			});
}
scope.pagedata.getlist();
window.addEventListener('scroll', function () {
	//alert('准备加载第二页');console.log('scope.isnodata');console.log(scope.loading);
	 var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
	// console.log(scrollTop);
    if(!scope.isnodata && !scope.loading &&  (scrollTop + window.innerHeight) >= document.documentElement.scrollHeight){
        scope.loading = true;  //状态标记
		scope.pagedata.getlist();
     }
})
</script>
<script>
	require(['bootstrap', 'hammer'], function($, Hammer){
		$('#carousel-container').carousel();
		var mc = new Hammer($('#carousel-container').get(0));
		mc.on("panleft", function(ev) {
			$('#carousel-container').carousel('next');
		});
		mc.on("panright", function(ev) {
			$('#carousel-container').carousel('prev');
		});
	});
</script>